package com.mk.sso.client.servlet;

import com.alibaba.fastjson.JSON;
import com.mk.sso.sdk.util.SsoUtil;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/getUser")
public class UserServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.getWriter().write(JSON.toJSONString(SsoUtil.getCurrentUser(request)));
    }
}
